package service.impl;

import entity.Message;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

/**
 * @author: bohao
 */
public class InnerService {


    private DriverManagerDataSource dataSource;

    public void updateFoo(Message msg) {
        JdbcTemplate template = new JdbcTemplate(dataSource);
        template.update("update USER_INFO set age = age + 20 where UNAME = 'tangmaru'");

        throw new RuntimeException("in failed");
        //System.out.println("in success!");
    }

    public void setDataSource(DriverManagerDataSource dataSource) {
        this.dataSource = dataSource;
    }
}
